from sanic import Blueprint, response
from models.wise_counsel import Wise_Counsel
counsel = Blueprint("wise_counsel")


@counsel.route("/grow/wise_counsel/counsel_list/<explore_id>")
async def counsel_list(request, explore_id):
    wc = await Wise_Counsel.filter(explore_id=explore_id)
    wc_list = [{"name": w.name, "introduction": w.introduction, "difficulty": w.difficulty} for w in wc]
    return response.json({"code": 200, "message": "", "data": wc_list})